<?php


namespace LazadaApi\Providers;


use Illuminate\Foundation\Application as LaravelApplication;
use Illuminate\Support\ServiceProvider;

class LazadaApiServiceProvider extends ServiceProvider
{

    /**
     * Setup the config.
     */
    protected function setupConfig()
    {
        $source = realpath(__DIR__.'/../../config/lazada.php');

        if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
            $this->publishes([$source => config_path('lazada.php')], 'lazada');
        }

        $this->mergeConfigFrom($source, 'lazada');
    }

    public function register()
    {
        $this->setupConfig();
    }
}